package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.check.businessseat;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.check.businessseat.BusinessSeatService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 分区位置控制器
 */
@Action
@RequestMapping(value="check/businessSeat")
public class BusinessSeatController extends BaseController {
    @Resource
    public BusinessSeatService businessSeatService;

    /**
     * 分区位置列表
     * @param  businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * @return
     */
    @At(value = "businessSeatListPage", method = RequestMethod.GET)
    public RespEntity businessSeatListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return businessSeatService.businessSeatListPage(jsonParam);
    }

    /**
     * 分区位置详情
     * @param  id	分区位置的id
     * @return
     */
    @At(value = "businessSeatDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity businessSeatDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return businessSeatService.businessSeatDetail(jsonParam);
    }

    /**
     * 分区位置新增
     * @param
     * partitionId	分区id
     * name	名称
     * @return
     */
    @At(value = "businessSeatAdd", method = RequestMethod.POST, param = { "partitionId","name" })
    public RespEntity businessSeatAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return businessSeatService.businessSeatAdd(jsonParam);
    }

    /**
     * 分区位置修改
     * @param
     * partitionId	分区id
     * name	名称
     * id	分区位置id
     * @return
     */
    @At(value = "businessSeatUpdate", method = RequestMethod.POST, param = { "partitionId","name","id" })
    public RespEntity businessSeatUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return businessSeatService.businessSeatUpdate(jsonParam);
    }

    /**
     * 分区位置删除
     * @param   id	分区位置的id
     * @return
     */
    @At(value = "businessSeatDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity businessSeatDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return businessSeatService.businessSeatDelete(jsonParam);
    }






   
}